package rmitut;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.RemoteException;

public class NodeClient {
	public static void main(String[] args){
		CommunicationHandler com = new CommunicationHandler();
		CommunicationServer comServer = com.getComServer();
		com.startCommunicationHandler("client");
		
		while(true){
			try {
				Thread.sleep(3000);
				Message m = new ConcreteMessage();
				comServer.sendMessage(m, InetAddress.getLocalHost(), "server");
			} catch (RemoteException e) {
				e.printStackTrace();
			} catch (UnknownHostException e) {
				e.printStackTrace();
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
